<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="g" uri="http://geni-max.com/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		<meta http-equiv="Cache-Control" content="no-cache" />
		<meta http-equiv="Expires" content="0" />
		<title>卓越网络管理系统</title>
		<link rel="stylesheet" type="text/css" href="../css/public.css" />
		<script type="text/javascript" src="../js/Form.js"></script>
		<script type="text/javascript" src="../js/Calendar.js"></script>
		<script type="text/javascript" src="../js/ext-3.0.3/adapter/ext/ext-base.js" charset="UTF-8"></script>
		<script type="text/javascript" src="../js/ext-3.0.3/ext-all-debug.js" charset="UTF-8"></script>
		<script type="text/javascript" src="../js/ext-3.0.3/source/locale/ext-lang-zh_CN.js" charset="UTF-8"></script>
	</head>
	<body>
		<table class="tab">
			<jsp:include page="base_info_gcblx.jsp" />
			<jsp:include page="base_info_kgsq.jsp" />
			<jsp:include page="base_info2.jsp" />
		</table>
		<form  id="tform" method="post" action="roomProject!process.action" style="margin-top:1px;">
			<input type="hidden" name="id" value="${roomProject.id}" />
			<input type="hidden" name="taskId" value="${taskId}" />
			<table class="tab">
				<tr>
					<td class="label" width="12%">投资工单号：</td>
					<td width="16%"><input size="10" maxlength="64" name="roomProject.workMenuNumberOne" value="${roomProject.workMenuNumberOne}" id="workmenunumberone"/></td>
					<td class="label" width="12%">成本工单号：</td>
					<td width="12%"><input size="10" maxlength="64" name="roomProject.workMenuNumberTwo" value="${roomProject.workMenuNumberTwo}" id="workmenunumbertwo"/></td>
					<td class="label" width="12%">地址编码：</td>
					<td width="12%"><input size="10" maxlength="64" name="roomProject.addressCode" value="${roomProject.addressCode}" id="addresscode"/></td>
					<td class="label" width="12%">土建投资归属：</td>
					<td width="12%"><input size="10" maxlength="64" name="roomProject.civilInvestBelong" value="${roomProject.civilInvestBelong}" id="civilinvestbelong"/></td>
				</tr>
				<tr>
					<td class="label">美化体投资归属：</td>
					<td><input size="10" maxlength="64" name="roomProject.bodycareInvestBelong" value="${roomProject.bodycareInvestBelong}" id="bodycareinvestbelong"/></td>
					<td class="label">覆盖延伸投资归属：</td>
					<td><input size="10" maxlength="64" name="roomProject.fgysInvestBelong" value="${roomProject.fgysInvestBelong}" id="fgysinvestbelong"/></td>
					<td class="label">直放站投资归属：</td>
					<td><input size="10" maxlength="64" name="roomProject.repeaterInvestBelong" value="${roomProject.repeaterInvestBelong}" id="repeaterinvestbelong"/></td>
					<td class="label">直放站Mis任务号：</td>
					<td><input size="10" maxlength="64" name="roomProject.repeaterMisCode" value="${roomProject.repeaterMisCode}" id="repeatermiscode"/></td>
				</tr>
				<tr>
					<td class="label">覆盖延伸Mis任务号：</td>
					<td><input size="10" maxlength="64" name="roomProject.fgysMisCode" value="${roomProject.fgysMisCode}" id="fgysmiscode"/></td>
					<td class="label">动力配套Mis任务号：</td>
					<td><input size="10" maxlength="64" name="roomProject.horsePowerMisCode" value="${roomProject.horsePowerMisCode}" id="horsepowermiscode"/></td>
					<td class="label" width="12%">批复日期：</td>
					<td colspan="3"><input size="10" readonly="readonly" style="cursor:text;" onclick="showDateGrid(this)" maxlength="64" name="roomProject.replyDate" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${roomProject.replyDate}" type="both" />" id="replydate"/></td>
				</tr>
				<tr>
					<td class="label" width="12%">操作说明：</td>
					<td colspan="7">
						<textarea rows="3" name="operateRemark"></textarea>
					</td>
				</tr>
				<tr>
					<td colspan="8" class="tcenter">
						<input type="hidden" id="actionName" name="actionName" value="提交" />
						<button type="button" onclick="submitByType('tijiao');" >提交</button>
						<button type="button" onclick="submitByType('huitui');">退回</button>
						<button type="button" onclick="submitByType('htfgs');">退回分公司</button>
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>
<script language="javascript">
function checkForm() {
	var needcivil = "${roomProject.needCivil}";
	var bodycareType = "${roomProject.bodycareType}";
	var horsepower = "${roomProject.horsePowerSuit}";
	var workmenunumberone = document.getElementById('workmenunumberone').value;
	var workmenunumbertwo = document.getElementById('workmenunumbertwo').value;
	var addresscode = document.getElementById('addresscode').value;
	var civilinvestbelong = document.getElementById('civilinvestbelong').value;
	var bodycareinvestbelong = document.getElementById('bodycareinvestbelong').value;
	var fgysinvestbelong = document.getElementById('fgysinvestbelong').value;
	var repeaterinvestbelong = document.getElementById('repeaterinvestbelong').value;
	var repeatermiscode = document.getElementById('repeatermiscode').value;
	var fgysmiscode = document.getElementById('fgysmiscode').value;
	var horsepowermiscode = document.getElementById('horsepowermiscode').value;
	var replydate = document.getElementById('replydate').value;
	
	var gsmtype = "${roomProject.gsmBuildType}";

	
	if(workmenunumberone == null || workmenunumberone ==''){
		alert("投资工单号不可以为空");
		document.getElementById('workmenunumberone').focus();
		return false;
	}
	if(workmenunumbertwo == null || workmenunumbertwo ==''){
		alert("成本工单号不可以为空");
		document.getElementById('workmenunumbertwo').focus();
		return false;
	}
	if(addresscode == null || addresscode ==''){
		alert("地址编码不可以为空");
		document.getElementById('addresscode').focus();
		return false;
	}
	if(needcivil == 'true'){
		if(civilinvestbelong == null || civilinvestbelong ==""){
			alert("土建投资归属不可以为空");
			document.getElementById('civilinvestbelong').focus();
			return false;
		}
	}

	if(bodycareType != null && bodycareType != ""){
		if(bodycareinvestbelong == null || bodycareinvestbelong ==''){
			alert("美化体投资归属型不可以为空");
			document.getElementById('bodycareinvestbelong').focus();
			return false;
		}
	}

	if(fgysinvestbelong == null || fgysinvestbelong ==''){
		alert("覆盖延伸投资归属不可以为空");
		document.getElementById('fgysinvestbelong').focus();
		return false;
	}
	if(gsmtype != null && gsmtype != "" && gsmtype.indexOf('直放站') != -1){
		if(repeaterinvestbelong == null || repeaterinvestbelong ==''){
			alert("直放站投资归属不可以为空");
			document.getElementById('repeaterinvestbelong').focus();
			return false;
		}
		if(repeatermiscode == null || repeatermiscode ==''){
			alert("直放站Mis任务号不可以为空");
			document.getElementById('zfzbuildcost').focus();
			return false;
		}
	}
	if(fgysmiscode == null || fgysmiscode ==''){
		alert("覆盖延伸Mis任务号不可以为空");
		document.getElementById('fgysmiscode').focus();
		return false;
	}
	if(horsepower == "true"){
		if(horsepowermiscode == null || horsepowermiscode ==''){
			alert("动力配套Mis任务号不可以为空");
			document.getElementById('horsepowermiscode').focus();
			return false;
		}
	}
	if(replydate == null || replydate ==''){
		alert("批复日期不可以为空");
		document.getElementById('replydate').focus();
		return false;
	}
	return true;
}

function submitByType(type){
	if(type =='tijiao'){
		var checked = checkForm();
		if(checked == true){
			document.getElementById('actionName').value = '提交';
			document.getElementById('tform').submit();
		}else{
			return false;
		}
	}else{
		if(type == 'huitui'){
			if (!confirm('确定要退回吗？')) {return false;} 
			document.getElementById('actionName').value = '退回';
			document.getElementById('tform').submit();
		}
		if(type == 'htfgs'){
			if (!confirm('确定要退回分公司吗？')) {return false;}
			document.getElementById('actionName').value = '退回分公司';
			document.getElementById('tform').submit();
		}
	}
}
Ext.onReady(function() {
	var gsmtype = "${roomProject.gsmBuildType}";
	var needcivil = "${roomProject.needCivil}";
	var bodycareType = "${roomProject.bodycareType}";
	if(needcivil == 'false'){
		document.getElementById('civilinvestbelong').value = '土建投资归属';
		document.getElementById('civilinvestbelong').disabled = true;
	}else{
		document.getElementById('civilinvestbelong').disabled = false;
	}
	
	if(gsmtype != null && gsmtype != "" && gsmtype.indexOf('直放站') != -1){
		document.getElementById('repeaterinvestbelong').disabled = false;
		document.getElementById('repeatermiscode').disabled = false;
	}else{
		document.getElementById('repeaterinvestbelong').value = '直放站投资归属';
		document.getElementById('repeaterinvestbelong').disabled = true;
		document.getElementById('repeatermiscode').value = '直放站MIS任务号';
		document.getElementById('repeatermiscode').disabled = true;
	}
	if(bodycareType != null && bodycareType != ""){
		document.getElementById('bodycareinvestbelong').disabled = false;
	}else{
		document.getElementById('bodycareinvestbelong').value ='美化体投资归属';
		document.getElementById('bodycareinvestbelong').disabled = true;
	}
});
</script>